import Vue from "vue";
import VueRouter from "vue-router";
import App from "../views/Index.vue";
import HomeView from "../views/HomeView";

Vue.use(VueRouter);

const routes = [
  {
    path: "/cinemadetails",
    name: "影院详情",
    component: () => import("../views/CinemaDetails.vue"),
  },
  {
    path: "/",
    name: "主页",
    component: App,
  },
  {
    path: "/home",
    name: "首页",
    component: HomeView,
  },
  {
    path: "/movie",
    name: "电影",
    component: () => import("../views/MovieView.vue"),
  },
  {
    path: "/cinema",
    name: "影院",
    component: () => import("../views/CinemaView.vue"),
  },
  // {
  //   path: "/perdetails",
  //   name: "影院",
  //   component: () => import('../views/PerDetails.vue'),
  // },
  {
    path: "/me",
    name: "我的",
    component: () => import("../views/MeView.vue"),
    children: [{
      path: 'perdetails',
      name: 'perdetails',
      component: () => import('../views/PerDetails.vue')
    },
    {
      path: 'myorder',
      name: 'myorder',
      component: () => import('../views/MyOrder.vue')
    },
    {
      path: 'wannasee',
      name: 'wannasee',
      component: () => import('../views/WannaSee.vue')
    },
    {
      path: 'watched',
      name: 'watched',
      component: () => import('../views/HavaWatched.vue')
    },
    {
      path: "grade",
      name: "评分",
      component: () => import("../views/Grade.vue"),
    },]
  },
  {
    path: '/login',
    name: '登录',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: '注册',
    component: () => import('../views/Register.vue')
  },

  {
    path: '/repwd',
    name: '修改密码',
    component: () => import('../views/Repwd.vue')
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
